import urllib.request
from bs4 import BeautifulSoup



if __name__ == '__main__':
    url = 'https://www.starbucks.com.cn/menu/'
    headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0'}
    request = urllib.request.Request(url=url,headers=headers)
    opens = urllib.request.urlopen(request)
    com = opens.read().decode('utf-8')

    print(com)
    soup = BeautifulSoup(com,'lxml')

    name_list = soup.select('ul[class="grid padded-3 product"] strong')
    print(name_list)
    # for name in name_list:
    #     print(name.string())